class Solution:
    def findTheLongestSubstring(self, s: str) -> int:
        n = len(s)
        y = ("a", "e", "i", "o", "u")
        ans = ""
        def valid(dic: dict):
            # print(dic)
            for i in dic.values():
                if i % 2 != 0:
                    return False
            else:
                return True
        for i in range(n):
            if n - i - 1 < len(ans):
                break
            tmp = ""
            mom = {"a":0, "e":0, "i":0, "o": 0, "u": 0}
            for j in range(i, n):
                if s[j] in mom:
                    mom[s[j]] += 1

                if valid(mom):
                    tmp = s[i:j+1]
                

            if len(ans) < len(tmp):
                ans = tmp

        return len(ans)
if __name__ == "__main__":
    r = Solution().findTheLongestSubstring("eleetminicoworoep")
    print(r)